﻿using System.Web.UI.HtmlControls;

namespace Job.Core.Web.UI
{   
    /// <summary>
    /// 代表 html 中的 select 下拉框。
    /// </summary>
    public class Select : HtmlSelect
    {
        protected override void RenderAttributes(System.Web.UI.HtmlTextWriter writer)
        {
            base.Attributes.Remove("ID");
            base.Attributes.Remove("Name");
            base.Attributes.Remove("DataValueField");
            base.Attributes.Remove("DataTextField");
            base.Attributes.Remove("DataMember");
            base.Attributes.Remove("DataSourceID");

            if (!string.IsNullOrEmpty(this.ID))
            {
                base.Attributes.Add("id", this.ID);
                base.Attributes.Add("name", this.ID);
            }
           
            this.Attributes.Render(writer);
        }
    }
}